Caption = "The mad cow test.Have you had yours lately?"
BeginProperty Font
Name = "Child's Play"
Size = 21.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 0
TabIndex = 2
Top = 120
Width = 4455
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'Sets the position of the window
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
'Set the parent of ANY object (can be lots of fun! ;-)
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
'Get the hWnd of the object's parent
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
'Get the current cursor Hot-Spot position
Private Type POINTAPI
X As Long
Y As Long
End Type
Const a_Radius = 30 'Acceptable Radius the cursor can be
'within for the button to 'grab' the cursor
Const HWND_TOPMOST = -1
Dim XnY As POINTAPI, ExitDo As Boolean
Private Sub cmdNoBut_Click()
cmdYesBut.ZOrder 0 'Set the follower button to infront
tmrFollow.Enabled = True 'Start the button moving!
End Sub
Private Sub cmdYesBut_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'The Click event doesn't work when the button's parent is set to None
ExitDo = True
'Stop the Do..Loop from running, though you don't need
'this if you're going to unload the form like this
If GetParent(cmdYesBut.hwnd) <> Me.hwnd Then cmdYesBut.Visible = False
'If the parent was set to anything other than the form
'then make it invisible, so it wont get infront of the
'message box
start.Show
Unload frmmain
End Sub
Private Sub tmrFollow_Timer()
GetCursorPos XnY
XnY.X = ScaleX(XnY.X, vbPixels, vbTwips) 'Change the dimensions from Pixels